package com.zhuangjie.mvc.validator.annotate.enum_valid;

import com.zhuangjie.mvc.validator.handler.EnumValidValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 枚举校验
 * @author zhuangjie
 */
@Documented
@Constraint(validatedBy = {EnumValidValidator.class})
@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface EnumValid {

    String message() default "输入的枚举值不在指定枚举类的值内！";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    Class<? extends VerifiableEnum> value();

    boolean allowNull() default false;

}